<div class = "main-view"><!--最外层div-->
    <div class="left-margin top-margin"><strong class="am-text-primary am-text-lg">用户列表</strong></div>

    <form class="am-form-inline left-margin top-margin" role="form">
        <div class="am-form-group">
            <label>登录用户名</label> <input type="text" class="am-form-field" ng-model="desc">
        </div>
        <button type="submit" class="am-btn am-btn-primary" ng-click="search()">搜索</button>
    </form>
    <br>

    <div class="am-btn-group am-btn-group-xs left-margin top-margin">
        <button type="button" class="am-btn am-btn-default" data-am-modal="{target: '#doc-modal-add', width: 800, height: 650}"><span class="am-icon-plus"></span> 新增</button>
        <button type="button" class="am-btn am-btn-default" ng-click="delete()"><span class="am-icon-trash-o"></span> 删除</button>
    </div>
    <div id = "pagination" class = "pagination"></div>
    <div class="pagination-table left-margin" id="tab_menu" style = "margin-top: 0px;">
        <form class="am-form">
            <table class="am-table am-table-striped am-table-hover table-main">
                <thead>
                <tr>
                    <th class="table-check"><input type="checkbox" ng-click="allSelected()"></th>
                    <th class="table-id">用户ID</th>
                    <th class="table-title">登录用户名</th>
                    <th class="table-title">昵称</th>
                    <!--<th class="table-title">用户类型</th>-->
                    <th class="table-title">是否是管理员</th>
                    <th class="table-title">是否有效</th>
                    <th class="table-title">创建时间</th>
                    <th class="table-title">备注</th>
                    <th class="table-title">操作</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="user in userList"  id = "{{user.sysUserID}}">
                    <td class="table-check"><input type="checkbox" class = "item-check"></td>
                    <td>{{user.sysUserID}}</td>
                    <td>{{user.loginName}}</td>
                    <td>{{user.nickName}}</td>
                    <!--<td>{{user.userType}}</td>-->
                    <td>{{user.isSupper?"是":"否"}}</td>
                    <td>{{user.isValid?"是":"否"}}</td>
                    <td>{{user.dateCreate | date:'yyyy-MM-dd HH:mm:ss'}}</td>
                    <td>{{user.remark}}</td>
                    <td>
                        <button class="am-btn am-btn-default am-btn-xs am-text-secondary" data-am-modal="{target: '#doc-modal-{{$index}}', width: 800, height: 650}" ng-click="getEditRole(user.role,$index)"><span class="am-icon-pencil-square-o"></span> 编辑</button>
                        <!--编辑框 -->
                        <div class="am-modal am-modal-no-btn" tabindex="-1" id="doc-modal-{{$index}}">
                            <div class="am-modal-dialog">
                                <div class="am-modal-hd border-bottom" style = "text-align: left;">菜单编辑
                                    <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>&times;</a>
                                </div>
                                <div class="am-modal-bd body-area">
                                    <div class = "text-left">
                                        <form>
                                            <div><label>昵称</label><input type="text" class = "modal-input" style = "width: 200px;display: inline-block;" ng-model="user.nickName"></div><br>
                                            <div><label>密码</label><input type="text" class = "modal-input" style = "width: 200px;display: inline-block;" ng-model="user.passWord"></div><br>
                                            <div><label>是否有效</label>
                                                <select data-am-selected="{btnSize: 'sm'}"  ng-model="user.isValid" style="margin-left: 0px;">
                                                    <option value=0>否</option>
                                                    <option value=1>是</option>
                                                </select>
                                            </div><br>
                                            <div><label>角色选择</label>
                                                <div class = "ral-list-choice" id = "ral-list-choice{{$index}}"></div>
                                            </div>
                                            <div><label>备注</label><textarea type="text" class = "modal-textarea" style = "display: inline-block;" ng-model="user.remark"></textarea></div>
                                        </form>
                                    </div>
                                </div>
                                <div class = "button-area border-top">
                                    <button type="button" class="am-btn am-btn-success right-margin top-margin" ng-show="true" ng-click="update(user,$event)">保存</button>
                                </div>
                            </div>
                        </div>

                    </td>

                </tr>
                </tbody>
            </table>
        </form>
    </div>


    <!--<div class = "left-margin">共<span id = 'page_number'>{{pageNumber}}</span>页 <span>{{count}}条数据</span></div>-->
    <!--新增框 -->
    <div class="am-modal am-modal-no-btn" tabindex="-1" id="doc-modal-add">
        <div class="am-modal-dialog">
            <div class="am-modal-hd border-bottom" style = "text-align: left;">新增用户
                <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>&times;</a>
            </div>
            <div class="am-modal-bd body-area">
                <div class = "text-left">
                    <form>
                        <div><label>登录用户名</label><input type="text" class = "modal-input" ng-model="addData.loginName"></div><br>
                        <div><label>密码</label><input type="text" class = "modal-input" ng-model="addData.passWord"></div><br>
                        <div><label>昵称</label><input type="text" class = "modal-input" ng-model="addData.nickName"></div><br>

                        <div><label>是否有效</label>
                            <select data-am-selected="{btnSize: 'sm'}"  ng-model="addData.isValid" style="margin-left: 0px;">
                                <option value=0>否</option>
                                <option value=1>是</option>
                            </select>
                        </div><br>

                        <div><label>角色选择</label>
                            <div class = "ral-list-choice" id = "ral-list-choice">

                            </div>
                        </div>
                        <div><label>备注</label><textarea type="text" class = "modal-textarea" ng-model="addData.remark"></textarea></div>
                    </form>
                </div>

            </div>
            <div class = "button-area border-top">
                <button type="button" class="am-btn am-btn-success right-margin top-margin" ng-show="true" ng-click="add(addData)">保存</button>
            </div>
        </div>
    </div>

</div>